 /*
 * @description: 客服系统自动登录入口，用于总后台携带session_ticket跳转
 * @Author: along
 * @Date: 2020-10-15
 * @Last Modified by: along
 * @Last Modified time: 2020-10-15
 */
<template>
    <div></div>
</template>

<script>
export default {
    data () {
        return {};
    },
    created () {
        if(this.$route.query.session_ticket) {
            localStorage.removeItem('sessionTicket');
            localStorage.setItem('sessionTicket', this.$route.query.session_ticket);
            this.$store.commit('global/SET_LOGIN', true);
            sessionStorage.setItem('CUSTOM_LOGIN', true);

            this.$router.push({path: '/'});
        } else {
            this.$router.push({path: '/login'});
        }
    }
};
</script>